import 'package:get/get.dart';
import '../repositories/user_repository.dart';
import '../services/user_service.dart';
import '../controller/network_demo_controller.dart';
import '../../../core/network/api_client.dart';

class NetworkDemoBinding extends Bindings {
  @override
  void dependencies() {
    // 初始化网络客户端
    ApiClient().init();
    
    // 注册依赖 - 可以切换使用真实API或Mock数据
    Get.lazyPut<UserRepository>(() => MockUserRepository());
    // Get.lazyPut<UserRepository>(() => ApiUserRepository()); // 使用真实API
    
    Get.lazyPut<UserService>(() => UserService(Get.find()));
    Get.lazyPut<NetworkDemoController>(() => NetworkDemoController(Get.find()));
  }
}